/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #794afa;
    --secondary-dark-color: #453c5c;
    --white-color: #fff;
    --light-bg-color: #f2f3f5;
    --light-text-color: #7c899a;
    --border-color: #e5e8ec;
    --dark-color: #0a021c;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #ff5252;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--secondary-dark-color);
}

.section-header p {
    color: var(--light-text-color);
    font-size: 1.1rem;
}

/* 预加载动画 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader .loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-bg-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 999;
    transition: var(--transition);
}

.navbar.scrolled {
    background-color: var(--white-color);
    box-shadow: var(--box-shadow);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-dark-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.cart-icon {
    position: relative;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: var(--white-color);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-dark-color);
    margin: 5px 0;
    transition: var(--transition);
}

/* 英雄区域样式 */
.hero {
    padding: 150px 0 100px;
    background-color: var(--light-bg-color);
    overflow: hidden;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    padding-right: 50px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--secondary-dark-color);
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--light-text-color);
    margin-bottom: 30px;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 商品区域样式 */
.products {
    padding: 100px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: var(--white-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--secondary-dark-color);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.product-rating {
    color: #ffc107;
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.add-to-cart:hover {
    background-color: #6a3af5;
}

/* 特色区域样式 */
.features {
    padding: 80px 0;
    background-color: var(--light-bg-color);
}

.features .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 40px 30px;
    background-color: var(--white-color);
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-10px);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-dark-color);
}

.feature p {
    color: var(--light-text-color);
}

/* 评价区域样式 */
.testimonials {
    padding: 100px 0;
}

.testimonial-slider {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.testimonial-slide {
    background-color: var(--white-color);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    text-align: center;
    display: none;
}

.testimonial-slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.testimonial-content {
    font-size: 1.1rem;
    color: var(--light-text-color);
    margin-bottom: 30px;
    line-height: 1.8;
}

.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 20px;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 1.2rem;
    color: var(--secondary-dark-color);
    margin-bottom: 5px;
}

.author-info p {
    color: var(--light-text-color);
    font-size: 0.9rem;
}

.testimonial-nav {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.testimonial-nav button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    margin: 0 5px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.testimonial-nav button.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* 联系区域样式 */
.contact {
    padding: 100px 0;
    background-color: var(--light-bg-color);
}

.contact .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--secondary-dark-color);
}

.contact-info p {
    color: var(--light-text-color);
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.info-item i {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-right: 15px;
}

.contact-form {
    display: grid;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* 页脚样式 */
.footer {
    background-color: var(--secondary-dark-color);
    color: var(--white-color);
    padding: 80px 0 0;
}

.footer .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white-color);
    margin-bottom: 20px;
    display: inline-block;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.footer-links h3,
.footer-social h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3::after,
.footer-social h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links a {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-social a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    margin-right: 10px;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--primary-color);
    transform: translateY(-5px);
}

.copyright {
    text-align: center;
    padding: 20px 0;
    background-color: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* 购物车侧边栏样式 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--white-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
    color: var(--secondary-dark-color);
}

.close-cart {
    font-size: 1.5rem;
    color: var(--light-text-color);
    transition: var(--transition);
}

.close-cart:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 15px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--secondary-dark-color);
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
}

.quantity-btn {
    width: 25px;
    height: 25px;
    background-color: var(--light-bg-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.quantity {
    margin: 0 10px;
}

.remove-item {
    color: var(--light-text-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.remove-item:hover {
    color: var(--primary-color);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-dark-color);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: var(--secondary-color);
    color: var(--white-color);
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.checkout-btn:hover {
    background-color: #6a3af5;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 50px;
    }

    .hero-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: var(--white-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 30px;
        transition: var(--transition);
    }

    .nav-links.active {
        left: 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero {
        padding: 120px 0 80px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 25px;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .testimonial-slide {
        padding: 30px 20px;
    }
}